/* 数据分析页面专用样式 */

/* 筛选区域样式 */
.filters-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.filters-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.custom-date {
    display: none;
}

.custom-date.show {
    display: flex;
}

.apply-filter-btn,
.refresh-btn,
.export-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.apply-filter-btn {
    background: var(--primary-color);
    color: white;
}

.apply-filter-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.refresh-btn {
    background: var(--secondary-color);
    color: white;
}

.refresh-btn:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

.export-btn {
    background: var(--success-color);
    color: white;
}

.export-btn:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
}

/* 指标卡片样式 */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.metric-change .positive {
    color: var(--success-color);
    font-weight: 500;
}

.metric-change .negative {
    color: var(--danger-color);
    font-weight: 500;
}

.change-label {
    color: var(--text-secondary);
}

/* 图表行样式 */
.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 12px;
}

.chart-time-select,
.chart-type-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.chart-time-select:focus,
.chart-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.chart-body {
    min-height: 300px;
    position: relative;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chart-bg);
    border-radius: 4px;
    overflow: hidden;
}

/* 模拟图表样式 */
.usage-trend-chart {
    width: 100%;
    height: 100%;
    position: relative;
}

.usage-trend-chart .chart-lines {
    width: 100%;
    height: 240px;
    position: relative;
    margin-bottom: 20px;
}

.usage-trend-chart .chart-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent 0%, rgba(66, 153, 225, 0.1) 100%);
    z-index: 1;
}

.usage-trend-chart .chart-line:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.usage-trend-chart .chart-points {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 240px;
}

.usage-trend-chart .chart-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.usage-trend-chart .chart-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 240px;
    display: flex;
    align-items: flex-end;
}

.usage-trend-chart .grid-line {
    flex: 1;
    height: 100%;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 预约时段分布图表样式 */
.booking-distribution-chart {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.booking-distribution-chart .chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 0 10px;
}

.booking-distribution-chart .chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary-color), var(--primary-light));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
}

.booking-distribution-chart .chart-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.booking-distribution-chart .chart-bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.booking-distribution-chart .chart-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 饼图样式 */
.pie-chart {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
}

.pie-chart .chart-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: auto;
}

.pie-chart .chart-slices {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.pie-chart .chart-legend {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pie-chart .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.pie-chart .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* 数据表格行样式 */
.data-tables-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.table-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.table-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-controls {
    display: flex;
    gap: 12px;
}

.view-details-btn,
.export-table-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-details-btn:hover,
.export-table-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.table-body {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--table-header-bg);
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background-color 0.3s ease;
}

.data-table tbody tr:hover {
    background: var(--hover-bg);
}

.data-table .status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.data-table .status.pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

.data-table .status.resolved {
    background: var(--success-light);
    color: var(--success-color);
}

.data-table .trend {
    font-weight: 500;
}

.data-table .trend.positive {
    color: var(--success-color);
}

.data-table .trend.negative {
    color: var(--danger-color);
}

.data-table .action-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.data-table .action-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .metrics-row {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .chart-body {
        min-height: 250px;
    }
    
    .chart-placeholder {
        min-height: 250px;
    }
    
    .table-card {
        padding: 16px;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .table-controls {
        justify-content: flex-end;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .chart-card {
        padding: 12px;
    }
    
    .table-card {
        padding: 12px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.metric-card,
.chart-card,
.table-card {
    animation: fadeInUp 0.5s ease-out;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

.chart-card:nth-child(1) { animation-delay: 0.2s; }
.chart-card:nth-child(2) { animation-delay: 0.3s; }

.table-card:nth-child(1) { animation-delay: 0.4s; }
.table-card:nth-child(2) { animation-delay: 0.5s; }

/* 加载动画 */
.chart-loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 深色模式适配 */
.dark-mode .filter-group select,
.dark-mode .filter-group input[type="date"] {
    background: var(--dark-input-bg);
    border-color: var(--dark-border-color);
}

.dark-mode .chart-time-select,
.dark-mode .chart-type-select {
    background: var(--dark-input-bg);
    border-color: var(--dark-border-color);
}

.dark-mode .view-details-btn,
.dark-mode .export-table-btn {
    background: var(--dark-input-bg);
    border-color: var(--dark-border-color);
}

.dark-mode .data-table .action-btn {
    background: var(--dark-input-bg);
    border-color: var(--dark-border-color);
}